package algorithm_demo.leetcode;

/**
 * 344. 反转字符串
 * <a href="https://leetcode.cn/problems/reverse-string/">https://leetcode.cn/problems/reverse-string/</a>
 *
 * @author Api
 * @date 2023/5/7 10:55
 */
public class Problem_344_ReverseString {
    public void reverseString(char[] s) {
        int i = 0;
        int j = s.length - 1;
        while (i < j) {
            char tmp = s[i];
            s[i] = s[j];
            s[j] = tmp;
            i++;
            j--;
        }
    }
}
